<?php
$Basedir = dirname(__FILE__);
$field_id = rex_request('field_id', 'int');
$id = rex_request('id','int');

//------------------------------> Eintragsliste
if ($func == '')
{
	$list = new rex_list('	SELECT * from '.$REX['TABLE_PREFIX'].'290_branchen order by haendler_branche');
	
	$imgHeader = '<a href="'. $list->getUrl(array('func' => 'add')) .'"><img src="media/metainfo_plus.gif" alt="add" title="add" /></a>';
	$list->setColumnSortable('ort');

	$list->addColumn(	$imgHeader, 
						'<img src="media/metainfo.gif" alt="field" title="field" />', 
						0, 
						array('<th class="rex-icon">###VALUE###</th>',
								'<td class="rex-icon">###VALUE###</td>')
					);					
	$list->setColumnParams	(	$imgHeader, 
								array('func' => 'edit', 'id' => '###id###')
							);
	
	
	$list->setColumnLabel('id', "ID");	
	$list->setColumnLabel('haendler_branche', 'Branche');
	
	$list->setColumnLayout	(	'id',
								array('<th class="rex-icon">###VALUE###</th>','<td class="rex-icon">###VALUE###</td>')
							);
	$list->setColumnParams('haendler_branche', array('func' => 'edit', 'id' => '###id###'));
	$list->show();
}
//------------------------------> Formular
elseif ($func == 'edit' || $func == 'add')
{	$form = new a290_rex_form($REX['TABLE_PREFIX'].'290_branchen',"Branche","id=".$id,"post",false);
	
	$field = &$form->addTextField('haendler_branche');
    $field->setLabel("Branche");
   
	if($func == 'edit')
    {	$form->addParam('id', $id);
    }

	$form->show();
	
}

?>